package com.igeek.boot.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author fengqq
 * @Description TODO
 * @Date 2024/8/20  14:23
 */
@RestController
@Slf4j
public class MyController {
    @Resource
    private JdbcTemplate jdbcTemplate;

    @GetMapping("/count")
    public Long selectCount(){
        Long count = jdbcTemplate.queryForObject("select count(*) from user", Long.class);
        log.info("查询用户的记录数量：{}",count);
        return count;
    }
}
